'''
Created on 23 mai 2009

@author: theo
'''
from pdftools.pdftext import Text

def contents_to_text (contents):
    for item in contents:
        if isinstance (item, type ([])):
            for i in contents_to_text (item):
                yield i
        elif isinstance (item, Text):
            yield item.text